﻿# -*- coding:utf-8 -*-
#
#
from django.conf import settings
from django.shortcuts import render_to_response
from django.template import RequestContext, Context
from homesite.images.models import Picture
from django.shortcuts import get_object_or_404

def index(request):
    img_list = Picture.objects.all()
    context = Context({
      'm': 'test',
      'img_list': img_list,
    })
    return render_to_response('images/index.html', context, context_instance=RequestContext(request))
    
    
def upload(request):
    context = Context({
      'm': 'test',
    })
    return render_to_response('images/upload.html', context, context_instance=RequestContext(request))    
    
    
    
def property(request, image_id):
    image = get_object_or_404(Picture, id=image_id)
    context = Context({
      'image': image,
    })
    return render_to_response('images/property.html', context, context_instance=RequestContext(request))     